package com.jake.microservice.trace.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Slf4j
public class Trace1Controller {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("")
    public String trace() {
        log.info("=== call trace 1 ===");
        return restTemplate.getForObject("http://sleuth-trace2", String.class);
    }
}
